﻿<UserControl x:Class="WpfImageDuplicates.ThumbnailView"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"             
             xmlns:y="clr-namespace:BrainTechLLC;assembly=SettingsLibrary"             
             xmlns:local="clr-namespace:WpfImageDuplicates"             
             KeyDown="UserControl_KeyDown"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006">
    <Grid x:Name="gridMain" Width="{Binding Mode=OneWay, Path=CurrentSettings.ThumbWidth}"
                            Height="{Binding Mode=OneWay, Path=CurrentSettings.ThumbHeight}">
        <Grid.RowDefinitions>
            <RowDefinition Height="18"/>
            <RowDefinition Height="18"/>
            <RowDefinition Height="*"/>
        </Grid.RowDefinitions>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="*"/>
            <ColumnDefinition Width="18"/>
        </Grid.ColumnDefinitions>
        <Border x:Name="btnImage" Padding="0" Margin="2"
                Grid.RowSpan="3" Grid.ColumnSpan="2"
                MouseRightButtonDown="btnImage_MouseRightButtonDown"
                PreviewMouseLeftButtonDown="btnImage_PreviewMouseLeftButtonDown"
                PreviewMouseLeftButtonUp="btnImage_PreviewMouseLeftButtonUp">
            <Image x:Name="imgMain" Stretch="Uniform" Margin="0"
                   Source="{Binding Mode=OneWay, Path=ThumbImageSourceCached}"/>
        </Border>
        <local:ThumbViewCommandBar x:Name="commandBar" HorizontalAlignment="Right" VerticalAlignment="Top" Grid.Column="1" Grid.RowSpan="4" 
                                   Visibility="{Binding Mode=OneWay, Path=ShowThumbCommandBar, Converter={StaticResource VisibilityConverter}}"                                   
                                   RequestDelete="commandBar_RequestDelete"
                                   RequestResizeDelete="commandBar_RequestResizeDelete"
                                   RequestRotate="commandBar_RequestRotate"
                                   RequestResize="commandBar_RequestResize"/>
        <local:ThumbViewBottom x:Name="ThumbViewBottom" Loaded="ThumbViewBottom_Loaded" FileImageViewModel="{Binding}"
                               Grid.Row="3" Grid.ColumnSpan="2" HorizontalAlignment="Stretch" VerticalAlignment="Bottom" Margin="4,0,0,0"
                               Canvas.ZIndex="999" Visibility="{Binding Mode=OneWay, Path=NoInfoDisplayedBelowThumbs, Converter={StaticResource VisibilityConverter}}" />
        
    </Grid>
</UserControl>
